package com.wxtt.android.adapter;

import android.text.TextUtils;
import android.widget.AbsListView;
import android.widget.ImageView;

import com.fast.dev.frame.Adapter.listview.AdapterHolder;
import com.fast.dev.frame.Adapter.listview.BaseListAdapter;
import com.fast.dev.frame.glide.GlideLoader;
import com.fast.dev.frame.utils.StringUtils;
import com.wxtt.android.R;
import com.wxtt.android.bean.VideoBean;

import java.util.List;

/**
 * 说明：VideoAdapter
 * <p/>
 * 作者：fanly
 * <p/>
 * 时间：2016/2/21 17:49
 * <p/>
 * 版本：verson 1.0
 */
public class VideoAdapter extends BaseListAdapter<VideoBean> {

    public VideoAdapter(AbsListView view, List<VideoBean> mDatas, int itemLayoutId) {
        super(view, mDatas, itemLayoutId);
    }

    @Override
    public void convert(AdapterHolder holder, VideoBean item, boolean isScrolling, int position) {
        ImageView iv = holder.getView(R.id.iv_card_image);
        if (!StringUtils.isEmpty(item.getBigThumbnail())){
            GlideLoader.into(item.getBigThumbnail(),iv,R.mipmap.place_holder, R.mipmap.place_holder);
        }else {
            GlideLoader.into(item.getThumbnail(), iv, R.mipmap.place_holder, R.mipmap.place_holder);
        }
        holder.setText(R.id.tv_card_title,item.getTitle());
    }
}
